package tn.insat.gl4.ppp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

public class SplashScreenActivity extends Activity {
	/**
	 * @see android.app.Activity#onCreate(Bundle)
	 */
	private static final int STOPSPLASH = 0;
    private static final long SPLASHTIME = 3000;

    private Handler splashHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case STOPSPLASH:
                    //remove SplashScreen from view
                    Intent intent = new Intent(SplashScreenActivity.this, DataGreedMenuActivity.class);
                    finish();
                    startActivity(intent);
                    break;
            }
            super.handleMessage(msg);
        }
    };

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.spashscreen);
        Message msg = new Message();
        msg.what = STOPSPLASH;
        splashHandler.sendMessageDelayed(msg, SPLASHTIME);
    }
    
    public Class getHomeActivityClass() {
        return SplashScreenActivity.class;
    }
}
